{include file="header"}
<div style="padding: 20px;">
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
  <ul class="layui-tab-title">
    <a href="/admin.php/muban/index.html"><li class="layui-this">本地模板</li></a>
    <a href="/admin.php/muban/zaixian.html"><li>在线模板</li></a>
  </ul>
  <div class="layui-tab-content"></div>
</div>   
<style>
div.img {
	border: 1px solid #ccc;
	border: 10px solid #f6f6f6;
	border-radius: 5px;
	transition: all .2s;
	-webkit-transition: all .2s;
}
div.img: hover {
	border-radius: 20px;
	border: 10px solid #e5e5e5;
	animation: myfirst 2s;
	-webkit-animation: myfirst 2s;
	Safari and Chrome
}
@keyframes myfirst {
	from {
	border: 10px solid #e5e5e5;
}
to {
	border: 10px solid #4dbdef;
}
}@-webkit-keyframes myfirst 
Safari and Chrome
	 {
	from {
	border: 10px solid #e5e5e5;
}
to {
	border: 10px solid #4dbdef;
}
}div.img img {
	width: 80%;
	height: 200px;
	box-shadow: 0 0 10px #393d49;
	margin-top: 10px;
	border-radius: 10px;
}
div.desc {
	white-space: nowrap;
	overflow: hidden;
	text-overflow : ellipsis;
	padding: 10px;
	text-align: center
}
* {
	box-sizing: border-box
}
.responsive {
	padding: 10px 6px;
	float: left;
	width: 24.99999%
}
@media only screen and (max-width: 700px) {
	.responsive {
	width: 100%;
	margin: 6px 0
}
div.img img {
	width: 80%;
	height: 150px;
}
}.clearfix: after {
	content: "";
	display: table;
	clear: both
}
</style>
<div style="padding:20px;" id="admin_set">{foreach name="muban" item="vo"}<div class="responsive"><div class="img" align="center"> <img src="{$vo.pic}" width="300" height="200"><div class="desc">{$vo.title} - V{$vo.version}</div>  <div class="desc"> 作者：<a target="_blank" href="{$vo.lianjie|default='http://www.115cms.com'}">{$vo.zuozhe}</a></div><div class="desc"> <form class="layui-form"> 
 <input type="text" name="WEB" value="{$vo.name}" placeholder="请输入内容" autocomplete="off" class="layui-input" style="display:none;">
  {if condition="config('web.WEB') eq $vo['name']"}
  <a class="layui-btn"  href="javascript:;" lay-submit="" lay-filter="mbant_add"  style="width:80%;  background-color: #039c03;">使用中.</a>
  {if condition="$vo['set'] eq 1"}
  <a class="layui-btn layui-btn-normal layui-btn-mini" data-method="admin_set" url="*URL*/index/index/cmspc" ><span class="button-content"> 设置</span></a>
  {/if} 
  {else /}
  <a class="layui-btn"  href="javascript:;" lay-submit="" lay-filter="mbant_add"  style="width:80%;  background-color: #bc04e2;">启动</a> 
  <a class="layui-btn layui-btn-normal layui-btn-mini shezhi"  lay-submit="" nickname="{$vo.name}"lay-submit lay-filter="un"><span class="button-content"> 删除</span></a>
  {/if} 
</form>
     </div>
    
  </div>
</div>
 {/foreach}
</div> 
<hr style="background-color: rgba(0,0,0,0);">
 <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend> <a href="/admin.php/muban/zaixian.html?or=2">手机模板【{if condition="config('web.WAPOPEN') eq 1"}开启中{else /}关闭中{/if} 】 </a> 
{if condition="config('web.WAPOPEN') eq 1"}
  <a style="margin-left:32px;" class="layui-btn layui-btn-small kg"  member-id="0">关闭</a>
{else /}
<a style="margin-left:32px;" class="layui-btn layui-btn-small kg"  member-id="1">开启</a>
{/if}  
  </legend>
</fieldset> 

<div style="padding:20px;" id="admin_set">{foreach name="mubanw" item="vo"}<div class="responsive"><div class="img" align="center"> <img src="{$vo.pic}" width="300" height="200"><div class="desc">{$vo.title} - V{$vo.version}</div>  <div class="desc"> 作者：<a target="_blank" href="{$vo.lianjie|default='http://www.115cms.com'}">{$vo.zuozhe}</a></div><div class="desc"> <form class="layui-form"> 
 <input type="text" name="WAP" value="{$vo.name}" placeholder="请输入内容" autocomplete="off" class="layui-input" style="display:none;">
  {if condition="config('web.WAP') eq $vo['name']"}
  <a class="layui-btn"  href="javascript:;" lay-submit="" lay-filter="mbant_addw"  style="width:80%;  background-color: #039c03;">使用中.</a>
  {if condition="$vo['set'] eq 1"}
  <a class="layui-btn layui-btn-normal layui-btn-mini" data-method="admin_set" url="*URL*/index/index/cmswap" ><span class="button-content"> 设置</span></a>
  {/if} 
  {else /}
  <a class="layui-btn"  href="javascript:;" lay-submit="" lay-filter="mbant_addw"  style="width:80%;  background-color: #bc04e2;">启动</a> 
  <a class="layui-btn layui-btn-normal layui-btn-mini shezhi"  lay-submit="" nickname="{$vo.name}"lay-submit lay-filter="unw"><span class="button-content"> 删除</span></a>
  {/if} 
</form>
     </div>
    
  </div>
</div>
 {/foreach}
</div>
 <script>
layui.use('form',function(){
  var form = layui.form
  ,jq = layui.jquery;
  
  jq('.kg').click(function(){
    var id = jq(this).attr('member-id');
      loading = layer.load(2, {
        shade: [0.2,'#000']
      });
      jq.post('/admin.php/muban/kg.html',{'id':id},function(data){
        if(data.code == 200){
          layer.close(loading);
          layer.msg(data.msg, {icon: 1, time: 1000}, function(){
            location.reload();
          });
        }else{
          layer.close(loading);
          layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
        }
      });
  });
  
  
  form.on('submit(un)', function(data){
  	var name = jq(this).attr('nickname');
  	var id = jq(this).attr('nickid');
    var param = data.field;
        layer.confirm('确定要删除吗？删除后只能重新下载', function(data) {
            loading = layer.load(20, {
                shade: [0.2, '#000']
            });
    jq.post('/admin.php/muban/un.html?info='+name+'',param,function(data){
        layer.close(loading);
        var downurl=data.path;
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.reload();
        });
    });
    
   });
    return false;
  });
  
  
  form.on('submit(unw)', function(data){
  	var name = jq(this).attr('nickname');
  	var id = jq(this).attr('nickid');
    var param = data.field;
        layer.confirm('确定要删除这手机模板吗？删除后只能重新下载', function(data) {
            loading = layer.load(20, {
                shade: [0.2, '#000']
            });
    jq.post('/admin.php/muban/unw.html?info='+name+'',param,function(data){
        layer.close(loading);
        var downurl=data.path;
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.reload();
        });
    });
    
   });
    return false;
  });
})

</script>
  
<script>
function muban(){  
  layui.use(
    ['layer', 'form'], function(){
    var layer = layui.layer,form = layui.form;layer.msg('当前使用中...');}
          
  );
}
layui.use('form',function(){
  var form = layui.form
  ,jq = layui.jquery;
  
  form.on('submit(mbant_add)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("muban/add")}',param,function(data){
      if(data.code == 200){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.href = '{:url("muban/index")}';
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });
  
  form.on('submit(mbant_addw)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("muban/addw")}',param,function(data){
      if(data.code == 200){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.href = '{:url("muban/index")}';
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });
  

})
function m(){  
  layui.use(
    ['layer', 'form'], function(){
    var layer = layui.layer,form = layui.form;layer.msg('{:config('web.addons')}');}
          
  );
}
</script>
</div>  
{include file="footer"}